from bs4 import BeautifulSoup
import requests

# 请求百度
response = requests.get("https://www.baidu.com")
# 设置编码方式
response.encoding = "utf-8"
# 使用bs解析网页
soup = BeautifulSoup(response.text,features="html.parser")
# 获取title标签
title = soup.select("title")
print(title)
print(title[0].text)